﻿<Window x:Class="TestNetReports.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="NetReports" xmlns:my="clr-namespace:TestNetReports" Loaded="Window_Loaded" Icon="/TestNetReports;component/Images/paste.ico" mc:Ignorable="d" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" Height="279" Width="388">
    <Window.Resources>
        <my:TestNetReportsDBDataSet x:Key="testNetReportsDBDataSet" />
        <CollectionViewSource x:Key="peopleViewSource" Source="{Binding Path=People, Source={StaticResource testNetReportsDBDataSet}}" />
    </Window.Resources>
    <Grid DataContext="{StaticResource peopleViewSource}">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="210*" />
        </Grid.ColumnDefinitions>
        <DataGrid EnableRowVirtualization="True" Height="199" HorizontalAlignment="Stretch" ItemsSource="{Binding}" Name="peopleDataGrid" RowDetailsVisibilityMode="VisibleWhenSelected" VerticalAlignment="Stretch" DataContext="{Binding UpdateSourceTrigger=PropertyChanged, BindsDirectlyToSource=True}" RowEditEnding="peopleDataGrid_RowEditEnding" AutoGenerateColumns="False" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" Grid.ColumnSpan="2" Margin="0,0,0,40">
            <DataGrid.Columns>
                <DataGridTemplateColumn x:Name="iDColumn" Header="ID" Width="SizeToHeader">
                    <DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <Label Content="{Binding Path=ID}" />
                        </DataTemplate>
                    </DataGridTemplateColumn.CellTemplate>
                </DataGridTemplateColumn>
                <DataGridTextColumn x:Name="firstNameColumn" Binding="{Binding Path=FirstName, BindsDirectlyToSource=True, UpdateSourceTrigger=PropertyChanged}" Header="First Name" Width="SizeToHeader" />
                <DataGridTextColumn x:Name="lastNameColumn" Binding="{Binding Path=LastName, UpdateSourceTrigger=PropertyChanged, BindsDirectlyToSource=True}" Header="Last Name" Width="SizeToHeader" />
                <DataGridTextColumn x:Name="middleNameColumn" Binding="{Binding Path=MiddleName, BindsDirectlyToSource=True, UpdateSourceTrigger=PropertyChanged}" Header="Middle Name" Width="SizeToHeader" />
            </DataGrid.Columns>
        </DataGrid>
        <Button Content="Generate" Height="23" HorizontalAlignment="Left" Margin="12,0,0,12" Name="button1" VerticalAlignment="Bottom" Width="122" Click="button1_Click" VerticalContentAlignment="Center" />
    </Grid>
</Window>
